package main

import (
	"fmt"
	"go-learn/go_learn/easyjson/student"
	"time"
)

func main() {
	s := student.Student{
		Id:   1,
		Name: "张三",
		School: student.School{
			Name: "小幼儿园",
			Addr: "北京路",
		},
		Birthday: time.Now(),
	}

	bt, err := s.MarshalJSON()
	fmt.Println(string(bt), err)

	jsonStr := string(bt)
	ss := student.Student{}
	ss.UnmarshalJSON([]byte(jsonStr))
	fmt.Printf("ss = %+v\n", ss)
}
